package cn.ciis;

import cn.ciis.basic.config.CiisConfig;
import cn.hutool.core.io.FileUtil;
import com.jfinal.server.undertow.UndertowServer;

/** @author 冉志林 */
public class AppStarted {
  /**
   * 项目启动
   *
   * @param args
   */
  public static void main(String[] args) {

      String configFile = null;
      if(FileUtil.exist("undertow_dev.properties")){
          configFile = "undertow_dev.properties";
      }else {
          configFile="undertow.properties";
      }

      UndertowServer.create(CiisConfig.class, configFile)
        .configWeb(
            builder -> {
              builder.addWebSocketEndpoint("cn.ciis.basic.websocket.AuthorityWebSocket");
            })
        .start();

  }
}